package br.com.async.controller.auth;

import java.io.Serializable;

import br.com.async.domain.login.User;
import br.com.caelum.vraptor.ioc.Component;
import br.com.caelum.vraptor.ioc.SessionScoped;


/**
 * @author rondymesquita
 *	Essa classe controla um objeto USER na sess�o
 */
@Component
@SessionScoped
public class UserComponent implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private User user;
	private String userName;
	private String urlHome;
	
	public User getUser() {
		return user;
	}
	
	public String getUserName() {
		return userName;
	}
	
	public void setUserName(String userName) {
		this.userName = userName;
	}
	
	public void setUser(User user) {
		this.user = user;
		this.userName = user.getPerson().getName();
	}
	public boolean isLogged() {
        return user != null;
    }

	public String getUrlHome() {
		return urlHome;
	}

	public void setUrlHome(String urlHome) {
		this.urlHome = urlHome;
	}
	

}
